import request from '@/utils/request'

// 查询导入记录
export function getRecords (classId, pageNum) {
  return request({
    url: '/peapi/records/records',
    method: 'get',
    params: {
      classId: classId,
      pageSize: 10,
      pageNum: pageNum
    }
  })
}

// 查询导入记录详情
export function getRecord (evaluateRecordId) {
  return request({
    url: '/peapi/records/record',
    method: 'get',
    params: {
      evaluateRecordId: evaluateRecordId
    }
  })
}

// 导入数据
export function importResultRaw (classId, rawFile) {
  const data = new FormData()
  data.append('classId', classId)
  data.append('file', rawFile)
  return request.post('/peapi/evaluate/import_result_raw', data)
}

// 下载模版
export function importTemplate (classId) {
  return request({
    url: '/peapi/evaluate/import_template',
    method: 'get',
    params: {
      classId: classId
    }
  })
}

// 导出报告
export function evaluateExport (params) {
  return request({
    url: '/peapi/evaluate/export',
    method: 'get',
    params: params
  })
}

